package com.flyme.module.base.provider.service.impl;

import com.flyme.common.core.model.query.CriteriaQuery;
import com.flyme.common.core.model.query.PagerInfo;
import com.flyme.common.core.model.query.PqGrid;
import com.flyme.core.base.supper.entity.EntityMap;
import com.flyme.core.base.supper.service.impl.BaseServiceImpl;
import com.flyme.module.base.client.entity.SysBlacklist;
import com.flyme.module.base.provider.mapper.SysBlacklistMapper;
import com.flyme.module.base.provider.service.SysBlacklistService;
import org.springframework.stereotype.Service;


@Service
public class SysBlacklistServiceImpl extends BaseServiceImpl<SysBlacklistMapper, SysBlacklist> implements SysBlacklistService {


    /**
     * 统计用户黑名单
     */
    public Integer count(String companyId, Long userId){
        return count(q().eq("companyId", companyId).eq(true, "userId", userId));
    }

    /**
     * 根据用户及企业删除黑名单
     */
    public boolean delByUser(String companyId, Long userId){
        return remove(q().eq("companyId", companyId).eq("userId", userId));
    }

}
